package com.efounder.frame.fragment;//package com.efounder.frame.fragment;
//
//import android.annotation.SuppressLint;
//import android.os.Build;
//import android.os.Bundle;
//import android.support.annotation.Nullable;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//import android.view.ViewTreeObserver;
//import android.widget.LinearLayout;
//import android.widget.TextView;
//
//import com.core.xml.StubObject;
//import com.efounder.frame.ViewSize;
//import com.efounder.frame.baseui.EFFragment;
//import com.efounder.frame.xmlparse.EFXmlConstants;
//import com.efounder.mobilemanager.R;
//
//import java.io.InputStream;
//
///**
// * Created by hudq on 2016/8/29. xx
// */
//
//public class EFAppAccountFormFragment extends EFFragment{
//    private int position;
//    private StubObject stubObject;
//
//    public static EFAppAccountFormFragment newInstance(int position, StubObject stubObject){
//        EFAppAccountFormFragment appAccountFragment = new EFAppAccountFormFragment();
//        Bundle bundle = new Bundle();
//        bundle.putInt("position",position);
//        bundle.putSerializable("stubObject", stubObject);
//        appAccountFragment.setArguments(bundle);
//        return appAccountFragment;
//    }
//
//    @Override
//    public void onCreate(@Nullable Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//        position = getArguments().getInt("position");
//        stubObject = (StubObject) getArguments().getSerializable("stubObject");
//    }
//
//    @Nullable
//    @Override
//    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//        View view = inflater.inflate(R.layout.ef_fragment_app_account_form,container,false);
//        TextView textView = (TextView) view.findViewById(R.id.textView_test);
//        textView.setText(position+"--" + stubObject.getCaption() +"--"+ stubObject.getString(EFXmlConstants.ATTR_FORM,""));
//
//        final LinearLayout ll = (LinearLayout) view.findViewById(R.id.rootLayout);
//
//        ll.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
//
//            @SuppressWarnings("deprecation")
//            @SuppressLint("NewApi")
//            public void onGlobalLayout() {
//
//                if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
//                    ll.getViewTreeObserver().removeGlobalOnLayoutListener(this);
//                } else {
//                    ll.getViewTreeObserver().removeOnGlobalLayoutListener(this);
//                }
//
//                addForm(ll);
//            }
//
//        });
//
//
//        return view;
//    }
//
//
//    private void addForm(LinearLayout ll ) {
////        InputStream inputStream =  getAssets().open("chaiyou.xml");
////        XML2Forms parse = new XML2Forms();
////        ApplicationContainer applicationContainer = parse.readXML(inputStream, new ViewSize(ll.getMeasuredWidth(),ll.getMeasuredHeight()));
////        FormApplication formApplication = applicationContainer.getFormApplication("");
////        FormViewContainer formViewContainer = (FormViewContainer) formApplication.getFormContainer("form1");
////        ll.removeAllViews();
////        ll.addView(formViewContainer);
//
//    }
//
//}
